package pers.mobian.springtenth;

import org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.stereotype.Component;

/**
 * @Date 2021/9/13 20:22
 * @Created mobian
 * @Description
 */
@Component
public class MergedBeanPostProcess implements MergedBeanDefinitionPostProcessor {
	@Override
	public void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class<?> beanType, String beanName) {

		if(beanName.equals("teacher")){
			beanDefinition.setInitMethodName("a");
			beanDefinition.getPropertyValues().add("name","mobian");
			beanDefinition.getPropertyValues().add("age",22);
		}
	}
}
